<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>设备信息管理</title>
	<meta name="decorator" content="ani"/>

</head>
<body>
<div class="wrapper wrapper-content">
<div class="row">
	<div class="col-md-12">
	<div class="panel panel-primary">
		<div class="panel-heading">
			<h3 class="panel-title">
				<a class="panelButton" href="${ctx}/web/yjEquipment"><i class="ti-angle-left"></i> 返回</a>
			</h3>
		</div>
		<div class="panel-body">
		<form:form id="inputForm" modelAttribute="yjEquipment" action="${ctx}/web/yjEquipment/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
            <input type="hidden" name="pageIndex" value="${pageIndex}">
            <sys:message content="${message}"/>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>设备号：</label>
					<div class="col-sm-10">
						<form:input path="number" htmlEscape="false" maxlength="30"  minlength="1"   class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>设备名称：</label>
					<div class="col-sm-10">
						<form:input path="name" htmlEscape="false" maxlength="30"  minlength="1"   class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>设备地址：</label>
					<div class="col-sm-10">
						<form:input path="city" htmlEscape="false" maxlength="30"  minlength="1"   class="form-control required"/>
					</div>
				</div>

				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>类型：</label>
					<div class="col-sm-10">
						<form:radiobuttons path="deviceType" items="${fns:getDictList('deviceType')}" itemLabel="label" itemValue="value" htmlEscape="false" class="i-checks required" onclick="changeDeviceTye()"/>
					</div>
				</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">净化器MAC：</label>
				<div class="col-sm-10">
					<form:input path="mac" htmlEscape="false" maxlength="30"  minlength="1"   class="form-control"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">麻将机MAC：</label>
				<div class="col-sm-10">
					<form:input path="majiangMac" htmlEscape="false" maxlength="30"  minlength="1"   class="form-control"/>
				</div>
			</div>

		<c:if test="${fns:hasPermission('web:yjEquipment:edit') || isAdd}">
				<div class="col-lg-3"></div>
		        <div class="col-lg-6">
		             <div class="form-group text-center">
		                 <div>
		                     <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="正在提交...">提 交</button>
		                 </div>
		             </div>
		        </div>
		</c:if>
		</form:form>
		</div>
	</div>
	</div>
</div>
</div>
	<script type="text/javascript">

        $(document).ready(function() {
            $("#inputForm").validate({
                submitHandler: function(form){
                    jp.loading();
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function(error, element) {
                    $("#messageBox").text("输入有误，请先更正。");
                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
        });
	</script>
</body>
</html>
